<!--阶梯气价申请-->
<template>
  <div class="heating-apply-for">
    <PageTitle class="boxTitle" :text="title"></PageTitle>
    <!-- <div class="date-tips">2023-07-04 11:26 发表于重庆</div> -->
    <div class="con-box detailContent">
      <div class="primary-tit title">阶梯气价优惠办理手续</div>
      <h3>一、一户多人口用户办理手续</h3>
      <h3>提供：</h3>
      <b class="b">1、房屋产权人有效身份证明原件或者复印件。</b>
      <b class="b">2、《居民户口薄》户主页、增减页或居住证《户口本、居住证上的地址需与用户编号绑定的地址一致》原件或复印件。</b>
      <b class="b">“一户多人口”认定有效期为 1 年，客户在年周期届满前重新申请，经复核后符合条件的，继续执行“一户多人口”标准，经复核后不符合条件的，取消“一户多人口”气量，执行普通居民客户气量标准。</b>
      <h3>二、低保用户办理手续</h3>
      <h3>提供：</h3>
      <b class="b">1、低保户有效身份证明原件或复印件</b>
      <b class="b">2、低保证明原件或复印件（低保证明上的地址需与用户编号绑定地址一致）</b>
      <b class="b">低保户优惠认定有效期为 1 年，客户在年周期届满前重新申请经复核后符合条件的，续执行“低保户优惠”，经复核后不符合条件的，取消“低保户优惠”，执行普通客户气量气价标准。</b>
      <div class="primary-tit title">申请信息</div>
      <div>
        <tui-button type="primary" @click="">一户多人口增加气量申请</tui-button>
        <tui-button type="primary" @click="">低保用户气价办理申请</tui-button>
      </div>
    </div>
    <!-- <div class="con-box tips">
      <div class="warning-tit title">温馨提示</div>
      <div>
        <p class="p">1. 使用采暖设备采暖的居民用户可申请采暖气量</p>
        <p class="p">2. 登记相关信息我司工作人员核实后登记采暖气量，享受采暖气量。</p>
      </div>
    </div> -->

    <FooterTel></FooterTel>
  </div>
</template>

<script>
import PageTitle from '../components/pageTitle.vue'
import FooterTel from '../components/footerTel.vue'
import TuiButton from "../../components/thorui/tui-button/tui-button.vue";
const rules = [{
  name: "name",
  rule: ["required"],
  msg: ["请输入姓名"]
  // }, {
  //   name: "address",
  //   rule: ["required"],
  //   msg: ["请输入地址"]
}, {
  name: "phone",
  rule: ["required", "isMobile"],
  msg: ["请输入手机号", "请输入正确的手机号"]
}];
export default {
  name: 'Detail',
  components: {
    TuiButton,
    PageTitle,
    FooterTel
  },
  data () {
    return {
      title: null,
      // openid: 'oi8TY6O8cwzuaSky6VNq214MHjVs',
      formData: {
        openid: '',
        name: '',
        // address: '',
        phone: '',
        content: '',
      },
      rules: rules,
      loading: false,
      openId: null,
    };
  },
  async onShow () {

  },
  async onLoad (e) {
    var vm = this;
    vm.title = e.title
  },
  created () {
  },
  methods: {
    submit () {
      var vm = this;
      vm.getId()
      if (!vm.$refs.form) return;
      vm.$refs.form.validate(vm.formData, vm.rules).then(res => {
        vm.formData.openid = vm.openId
        vm.loading = true
        vm.tui.request('/api/gasstep/add', 'post', vm.formData, false, false, true).then((res) => {
          if (res.code == 200) {
            uni.showToast({
              icon: "success",
              title: '添加成功'
            });
            setTimeout(() => {
              vm.formData = {}
              uni.redirectTo({
                url: '/pages/index/index'
              });
              vm.loading = false
            }, 500);
          }
        }).catch((e) => { })
      }).catch(errors => {
        console.log(errors)
      })
    },
    getId () {
      var vm = this;
      vm.openId = uni.getStorageSync('openId')
      // vm.openId = 'ou_2398f89wfgw98ft4378'
      // 没有openId跳转获取code页面
      if (!vm.openId) return vm.func.goto('/pages/getCode/index')
    }
  },
  mounted () {
    var vm = this;
    // uni.navigateTo({url: '/pages/multiPeopleAddGasApplyFor/index?type=1'})
    vm.getId()
  },
};
</script>

<style lang="scss" scoped>
@import "../../static/css/module.scss";
.heating-apply-for {
  padding-bottom: 20px;
  .boxTitle {
    margin: 10px 14px;
  }
  .detailContent,
  .tips {
    padding: 0 18px 20px;
    margin: 14px;
    font-size: 15px;
    line-height: 22px;
    overflow: hidden;
    .title {
      width: 100%;
      height: 30px;
      padding-left: 14px;
      line-height: 30px;
      font-size: 17px;
      font-weight: bold;
      color: #222;
      box-sizing: border-box;
      margin: 10px 0;
    }
    :v-deep .tui-textarea__wrap,
    :v-deep .tui-input__wrap {
      padding: 12px 0 12px 8px !important;
    }
    :v-deep .tui-placeholder,
    :v-deep .tui-textarea__label,
    :v-deep .tui-textarea__self,
    :v-deep .uni-input-placeholder,
    :v-deep .tui-input__label,
    :v-deep.tui-input__self {
      font-size: 15px !important;
      uni-text,
      text {
        font-size: 15px !important;
      }
    }
    :v-deep.tui-textarea__wrap {
      align-items: flex-start !important;
    }
    :v-deep .tui-input__required {
      left: 0;
      top: 45%;
    }
    .tui-btn__box {
      padding-top: 30px;
    }
  }
  :v-deep .tui-form__errmsg {
    left: 14px;
    right: 14px;
  }
}
</style>
